import request from '@/config/axios'

// 退住登记 VO
export interface RetreatVO {
  id: number // ID
  customerid: number // 客户ID
  retreatTime: Date // 退住时间
  retreatType: string // 退住类型
  retreatReason: string // 退出原因
  retreatStatus: string // 审批状态
  auditStatus: string // 审核意见
  auditPerson: string // 审核人
  auditTine: Date // 审核时间
}

// 退住登记 API
export const RetreatApi = {
  // 查询退住登记分页
  getRetreatPage: async (params: any) => {
    return await request.get({ url: `/yyzx/retreat/page`, params })
  },

  // 查询退住登记详情
  getRetreat: async (id: number) => {
    return await request.get({ url: `/yyzx/retreat/get?id=` + id })
  },

  // 新增退住登记
  createRetreat: async (data: RetreatVO) => {
    return await request.post({ url: `/yyzx/retreat/create`, data })
  },

  // 修改退住登记
  updateRetreat: async (data: RetreatVO) => {
    return await request.put({ url: `/yyzx/retreat/update`, data })
  },

  // 删除退住登记
  deleteRetreat: async (id: number) => {
    return await request.delete({ url: `/yyzx/retreat/delete?id=` + id })
  },

  // 导出退住登记 Excel
  exportRetreat: async (params) => {
    return await request.download({ url: `/yyzx/retreat/export-excel`, params })
  },
}